package com.lexin.common.base;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class SystemProperties {
	
	/*系统基本配置*/
	public static String ENCODING;			//字符编码

	private static final Properties properties;
	static {
		properties = new Properties();
		 try {
			init();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	/***
	 * 初始化
	 * @throws IOException
	 */
	private static void init() throws IOException {
		InputStream in = SystemProperties.class.getClassLoader().getResourceAsStream("config/system.properties");
		properties.load( new InputStreamReader(in, "UTF-8") );
		
		/*系统基本配置*/
		ENCODING = properties.getProperty("encoding","UTF-8");

		System.out.println("加载系统配置中...");
		System.out.println("==========System Properties==========");
		System.out.println("ENCODING="+ENCODING);
		System.out.println("系统配置加载完成！");
		
	}
	
//	public static void main(String[] args) {
//		String[] arr = "".split(",");
//		System.out.println(Arrays.asList(arr));
//	}
}
